local ffi = require("ffi");

ffi.cdef[[
    typedef short wchar_t;
    int IMG_Init(int flags);
    struct SDL_version* IMG_Linked_Version();
    struct SDL_Surface* IMG_Load(const char *file);
    struct SDL_Surface* IMG_LoadBMP_RW(SDL_RWops *src);
    struct SDL_Surface* IMG_LoadCUR_RW(SDL_RWops *src);
    struct SDL_Surface* IMG_LoadGIF_RW(SDL_RWops *src);
    struct SDL_Surface* IMG_LoadICO_RW(SDL_RWops *src);
    struct SDL_Surface* IMG_LoadJPG_RW(SDL_RWops *src);
    struct SDL_Surface* IMG_LoadLBM_RW(SDL_RWops *src);
    struct SDL_Surface* IMG_LoadPCX_RW(SDL_RWops *src);
    struct SDL_Surface* IMG_LoadPNG_RW(SDL_RWops *src);
    struct SDL_Surface* IMG_LoadPNM_RW(SDL_RWops *src);
    struct SDL_Surface* IMG_LoadTGA_RW(SDL_RWops *src);
    struct SDL_Surface* IMG_LoadTIF_RW(SDL_RWops *src);
    struct SDL_Texture* IMG_LoadTexture(SDL_Renderer *renderer,const char *file);
    struct SDL_Texture* IMG_LoadTextureTyped_RW(SDL_Renderer *renderer,SDL_RWops *src,int freesrc,const char *type);
    struct SDL_Texture* IMG_LoadTexture_RW(SDL_Renderer *renderer,SDL_RWops *src,int freesrc);
    struct SDL_Surface* IMG_LoadTyped_RW(SDL_RWops *src,int freesrc,const char *type);
    struct SDL_Surface* IMG_LoadWEBP_RW(SDL_RWops *src);
    struct SDL_Surface* IMG_LoadXCF_RW(SDL_RWops *src);
    struct SDL_Surface* IMG_LoadXPM_RW(SDL_RWops *src);
    struct SDL_Surface* IMG_LoadXV_RW(SDL_RWops *src);
    struct SDL_Surface* IMG_Load_RW(SDL_RWops *src,int freesrc);
    void IMG_Quit();
    struct SDL_Surface* IMG_ReadXPMFromArray(char **xpm);
    int IMG_SavePNG(SDL_Surface *surface,const char *file);
    int IMG_SavePNG_RW(SDL_Surface *surface,SDL_RWops *dst,int freedst);
    int IMG_isBMP(SDL_RWops *src);
    int IMG_isCUR(SDL_RWops *src);
    int IMG_isGIF(SDL_RWops *src);
    int IMG_isICO(SDL_RWops *src);
    int IMG_isJPG(SDL_RWops *src);
    int IMG_isLBM(SDL_RWops *src);
    int IMG_isPCX(SDL_RWops *src);
    int IMG_isPNG(SDL_RWops *src);
    int IMG_isPNM(SDL_RWops *src);
    int IMG_isTIF(SDL_RWops *src);
    int IMG_isWEBP(SDL_RWops *src);
    int IMG_isXCF(SDL_RWops *src);
    int IMG_isXPM(SDL_RWops *src);
    int IMG_isXV(SDL_RWops *src);    
]]
